package com.yueke.gemini.utils;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;

public class Tools {
	private static HttpClient client;
    private static GetMethod getMethod;
    static {
        client = new HttpClient();
    }
    public static String getStaticString(String URL){
    	 getMethod = new GetMethod(URL);
    	 String jsonText="";
    	 try {
             int status = client.executeMethod(getMethod);
             if (status == HttpStatus.SC_OK) {// HTTP 200 OK
                 jsonText = getMethod.getResponseBodyAsString();// 鑾峰彇瀛楃涓插舰寮忕殑缁撴灉锛屽缓璁娇鐢ㄦ祦寮忕粨鏋�
             }
         } catch (Exception e) {
             System.err.println(e);
         }
    	 return jsonText;
    }
}
